#/*
# * Copyright {c} 2020-2021, SERI Development Team
# *
# * SPDX-License-Identifier: Apache-2.0
# *
# * Change Logs:
# * Date         Author          Notes
# * 2022-03-27   Lyons           first version
# */

TARGET          = riscv

Q               = @

PROJPATH        = ../..
WORKPATH        = .

include ../config.mk

ALLDEFINE      += +define+SIM_UART_IAP

TBFILES        += ${PROJPATH}/tb/core_uart_iap_tb.v


INCLUDES       += -I.

INCFILES       += 

CFLAGS         += -O0 -ffunction-sections -fdata-sections
#CFLAGS         += -g
CFLAGS         += -DPRINT_STDIO_SIM

LDFLAGS        += -T${WORKPATH}/link.lds

LDLIBS         += 

ASMFILES       += 

CFILES          = ${PROJPATH}/libs/_sdk/systick/*.c \
                  ${PROJPATH}/libs/_sdk/timer/*.c \
                  ${PROJPATH}/libs/_sdk/uart/*.c \
                  ${PROJPATH}/libs/_utilities/*.c
CFILES         += ${WORKPATH}/main.c

include ../build.mk

.PHONY: build_app
build_app:
	@echo -e ${COLORS}[INFO] create app image file ...${COLORE}
	${Q}../../scripts/bin2packet ${WORKPATH}/../iap_app/riscv_app.bin > iap.data
	@echo -e ${COLORS}[INFO] execute done${COLORE}
